/********************************************************************
  Copyright by PCI, 2002-10-08
  File Name: db_ppm_product_his.cxx
  Created Date: 2002-10-08 
  Author: Machine
  Version: 1.0 
  Last Version Date: 
  Version Date:
*******************************************************************/
/********************************************************************
  Copyright by PCI, 2002-10-08
  Class Name: CTable_PPM_PRODUCT_HIS
  Created Date: 2002-10-08 
  Author: Machine
  Defined File: db_ppm_product_his.hxx
  Last Version Date: 
  Version Date:
*******************************************************************/
#include "table_ppm.h"

CTable_PPM_PRODUCT_HIS::CTable_PPM_PRODUCT_HIS( )
 :NPCRecordSet( )
{
  setTableName( "PPM_PRODUCT_HIS" );
  prepareTable();
  prepareQuery();
 
  HIS_ID.setField( "HIS_ID", DATA_CHAR, 20, 1 );
  makeTableItem( HIS_ID );
  makeKeyItem( HIS_ID ); 
  APP_ID.setField( "APP_ID", DATA_CHAR, 20, 0 );
  makeTableItem( APP_ID );
  PRODUCT_ID.setField( "PRODUCT_ID", DATA_DOUBLE, 22, 2 );
  makeTableItem( PRODUCT_ID );
  makeKeyItem(PRODUCT_ID);
  PRODUCT_NBR.setField( "PRODUCT_NBR", DATA_CHAR, 30, 0 );
  makeTableItem( PRODUCT_NBR );
  PRODUCT_NAME.setField( "PRODUCT_NAME", DATA_CHAR, 64, 0 );
  makeTableItem( PRODUCT_NAME );
  PRODUCT_DESC.setField( "PRODUCT_DESC", DATA_CHAR, 2048, 0 );
  makeTableItem( PRODUCT_DESC );
  MANAGE_GRADE.setField( "MANAGE_GRADE", DATA_CHAR, 3, 0 );
  makeTableItem( MANAGE_GRADE );
  PROD_BUNDLE_TYPE.setField( "PROD_BUNDLE_TYPE", DATA_CHAR, 3, 0 );
  makeTableItem( PROD_BUNDLE_TYPE );
  PRODUCT_PROVIDER_ID.setField( "PRODUCT_PROVIDER_ID", DATA_DOUBLE, 22, 0 );
  makeTableItem( PRODUCT_PROVIDER_ID );
  STATE_DATE.setField( "STATE_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( STATE_DATE );
  EFF_DATE.setField( "EFF_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( EFF_DATE );
  EXP_DATE.setField( "EXP_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( EXP_DATE );
  CREATE_DATE.setField( "CREATE_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( CREATE_DATE );
  PROD_FUNC_TYPE.setField( "PROD_FUNC_TYPE", DATA_CHAR, 6, 0 );
  makeTableItem( PROD_FUNC_TYPE );
  PRODUCT_STATE_CD.setField( "PRODUCT_STATE_CD", DATA_CHAR, 6, 0 );
  makeTableItem( PRODUCT_STATE_CD );
  PRODUCT_TYPE.setField( "PRODUCT_TYPE", DATA_CHAR, 6, 0 );
  makeTableItem( PRODUCT_TYPE );
  DIRECTION.setField( "DIRECTION", DATA_CHAR, 256, 0 );
  makeTableItem( DIRECTION );
  AREA_ID.setField( "AREA_ID", DATA_CHAR, 20, 0 );
  makeTableItem( AREA_ID );
  PAY_TYPE.setField( "PAY_TYPE", DATA_CHAR, 20, 0 );
  makeTableItem( PAY_TYPE );
  APP_STATE.setField( "APP_STATE", DATA_CHAR, 20, 0 );
  makeTableItem( APP_STATE );
  PROD_TYPE.setField( "PROD_TYPE", DATA_CHAR, 6, 0 );
  makeTableItem( PROD_TYPE );
  PRODFUNCTION.setField("PRODFUNCTION" ,DATA_CHAR,20,0);
  makeTableItem( PRODFUNCTION );
  STATE.setField("STATE" , DATA_CHAR , 20 , 0);
  makeTableItem( STATE );
  PRODSUPPLY.setField("PRODSUPPLY",DATA_CHAR,20,0);
  makeTableItem(PRODSUPPLY);
  REMARK.setField("REMARK",DATA_CHAR,1024,0);
  makeTableItem(REMARK);
  GROUP_PROD_ID.setField("GROUP_PROD_ID",DATA_CHAR,20,0);
  makeTableItem(GROUP_PROD_ID);
  REVISION.setField("REVISION",DATA_CHAR,20,0);
  makeTableItem(REVISION);
  STAFF.setField("STAFF",DATA_CHAR,20,0);
  makeTableItem(STAFF);
  INTERNAL_ID.setField("INTERNAL_ID",DATA_CHAR,20,0);
  makeTableItem(INTERNAL_ID);
  INTERNAL_CODE.setField("INTERNAL_CODE",DATA_CHAR,20,0);
  makeTableItem(INTERNAL_CODE);
  SP_CODE.setField( "SP_CODE", DATA_CHAR, 20, 0 );
  makeTableItem( SP_CODE );
  DEPLOY_MODE.setField( "DEPLOY_MODE", DATA_CHAR, 6, 0 );
  makeTableItem( DEPLOY_MODE );
  HOLD_FLAT.setField( "HOLD_FLAT", DATA_CHAR, 6, 0 );
  makeTableItem( HOLD_FLAT );
	SCOPE.setField( "SCOPE", DATA_CHAR, 3, 0 );
  makeTableItem( SCOPE );
  PRODUCT_HOST.setField( "PRODUCT_HOST", DATA_CHAR, 3, 0 );
  makeTableItem( PRODUCT_HOST );
}


CTable_PPM_PRODUCT_HIS::CTable_PPM_PRODUCT_HIS( NPConnection& pcldb )
 :NPCRecordSet( pcldb )
{
  setTableName( "PPM_PRODUCT_HIS" );
  prepareTable();
  prepareQuery();
 
  HIS_ID.setField( "HIS_ID", DATA_CHAR, 20, 1 );
  makeTableItem( HIS_ID );
  makeKeyItem( HIS_ID ); 
  APP_ID.setField( "APP_ID", DATA_CHAR, 20, 0 );
  makeTableItem( APP_ID );
  PRODUCT_ID.setField( "PRODUCT_ID", DATA_DOUBLE, 22, 2 );
  makeTableItem( PRODUCT_ID );
  makeKeyItem(PRODUCT_ID);
  PRODUCT_NBR.setField( "PRODUCT_NBR", DATA_CHAR, 30, 0 );
  makeTableItem( PRODUCT_NBR );
  PRODUCT_NAME.setField( "PRODUCT_NAME", DATA_CHAR, 64, 0 );
  makeTableItem( PRODUCT_NAME );
  PRODUCT_DESC.setField( "PRODUCT_DESC", DATA_CHAR, 2048, 0 );
  makeTableItem( PRODUCT_DESC );
  MANAGE_GRADE.setField( "MANAGE_GRADE", DATA_CHAR, 3, 0 );
  makeTableItem( MANAGE_GRADE );
  PROD_BUNDLE_TYPE.setField( "PROD_BUNDLE_TYPE", DATA_CHAR, 3, 0 );
  makeTableItem( PROD_BUNDLE_TYPE );
  PRODUCT_PROVIDER_ID.setField( "PRODUCT_PROVIDER_ID", DATA_DOUBLE, 22, 0 );
  makeTableItem( PRODUCT_PROVIDER_ID );
  STATE_DATE.setField( "STATE_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( STATE_DATE );
  EFF_DATE.setField( "EFF_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( EFF_DATE );
  EXP_DATE.setField( "EXP_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( EXP_DATE );
  CREATE_DATE.setField( "CREATE_DATE", DATA_DATETIME, 7, 0 );
  makeTableItem( CREATE_DATE );
  PROD_FUNC_TYPE.setField( "PROD_FUNC_TYPE", DATA_CHAR, 6, 0 );
  makeTableItem( PROD_FUNC_TYPE );
  PRODUCT_STATE_CD.setField( "PRODUCT_STATE_CD", DATA_CHAR, 6, 0 );
  makeTableItem( PRODUCT_STATE_CD );
  PRODUCT_TYPE.setField( "PRODUCT_TYPE", DATA_CHAR, 6, 0 );
  makeTableItem( PRODUCT_TYPE );
  DIRECTION.setField( "DIRECTION", DATA_CHAR, 256, 0 );
  makeTableItem( DIRECTION );
  AREA_ID.setField( "AREA_ID", DATA_CHAR, 20, 0 );
  makeTableItem( AREA_ID );
  PAY_TYPE.setField( "PAY_TYPE", DATA_CHAR, 20, 0 );
  makeTableItem( PAY_TYPE );
  APP_STATE.setField( "APP_STATE", DATA_CHAR, 20, 0 );
  makeTableItem( APP_STATE );
  PROD_TYPE.setField( "PROD_TYPE", DATA_CHAR, 6, 0 );
  makeTableItem( PROD_TYPE );
  PRODFUNCTION.setField("PRODFUNCTION" ,DATA_CHAR,20,0);
  makeTableItem( PRODFUNCTION );
  STATE.setField("STATE" , DATA_CHAR , 20 , 0);
  makeTableItem( STATE );
  PRODSUPPLY.setField("PRODSUPPLY",DATA_CHAR,20,0);
  makeTableItem(PRODSUPPLY);
  REMARK.setField("REMARK",DATA_CHAR,1024,0);
  makeTableItem(REMARK);
  GROUP_PROD_ID.setField("GROUP_PROD_ID",DATA_CHAR,20,0);
  makeTableItem(GROUP_PROD_ID);
  REVISION.setField("REVISION",DATA_CHAR,20,0);
  makeTableItem(REVISION);
  STAFF.setField("STAFF",DATA_CHAR,20,0);
  makeTableItem(STAFF);
  INTERNAL_ID.setField("INTERNAL_ID",DATA_CHAR,20,0);
  makeTableItem(INTERNAL_ID);
  INTERNAL_CODE.setField("INTERNAL_CODE",DATA_CHAR,20,0);
  makeTableItem(INTERNAL_CODE);
  SP_CODE.setField( "SP_CODE", DATA_CHAR, 20, 0 );
  makeTableItem( SP_CODE );
  DEPLOY_MODE.setField( "DEPLOY_MODE", DATA_CHAR, 6, 0 );
  makeTableItem( DEPLOY_MODE );
  HOLD_FLAT.setField( "HOLD_FLAT", DATA_CHAR, 6, 0 );
  makeTableItem( HOLD_FLAT );
	SCOPE.setField( "SCOPE", DATA_CHAR, 3, 0 );
  makeTableItem( SCOPE );
  PRODUCT_HOST.setField( "PRODUCT_HOST", DATA_CHAR, 3, 0 );
  makeTableItem( PRODUCT_HOST );
}

CTable_PPM_PRODUCT_HIS::~CTable_PPM_PRODUCT_HIS( )
{
    close();
}

